package com.lifeng.shop.lifengshop.servies.impl;

import com.lifeng.shop.lifengshop.mapper.CommentMapper;
import com.lifeng.shop.lifengshop.pojo.entry.Comment;
import com.lifeng.shop.lifengshop.pojo.vo.ProductCommentVO;
import com.lifeng.shop.lifengshop.servies.CommentServies;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author CLK
 */
@Service
public class CommentServiesImpl implements CommentServies {
    @Autowired
    private CommentMapper commentMapper;
    @Override
    public int deleteByPrimaryKey(Integer cid) {
        return commentMapper.deleteByPrimaryKey(cid);
    }

    @Override
    public int insert(Comment record) {
        return commentMapper.insert(record);
    }

    @Override
    public int insertSelective(Comment record) {
        return commentMapper.insertSelective(record);
    }

    @Override
    public Comment selectByPrimaryKey(Integer cid) {
        return commentMapper.selectByPrimaryKey(cid);
    }

    @Override
    public int updateByPrimaryKeySelective(Comment record) {
        return commentMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Comment record) {
        return commentMapper.updateByPrimaryKey(record);
    }

    @Override
    public Comment selectByUidAndGid(Integer uid, Integer gid) {
        return commentMapper.selectByUidAndGid(uid,gid);
    }

    @Override
    public List<ProductCommentVO> selectByGid(Integer gid) {
        return commentMapper.selectByGid(gid);
    }
}
